package com.angus.modules.front.repository;

import com.angus.modules.front.domain.FrontConfig;
import com.angus.modules.front.mapper.FrontConfigMapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Repository;


@Repository
public class FrontConfigRepository extends ServiceImpl<FrontConfigMapper, FrontConfig> {


    public FrontConfig getConfigByKey(String configKey) {

      return  baseMapper.selectOne(Wrappers.lambdaQuery(FrontConfig.class)
                .eq(FrontConfig::getConfigKey, configKey)
                .last("limit 1"));

    }
}
